package jee.boot.common.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 项目设置信息
 * 
 * @author zhilei.wang
 *
 */
@Component
@ConfigurationProperties(prefix = "project")
public class ProjectConfig implements Serializable {
	private static final long serialVersionUID = 1L;
	/**
	 * 项目名称
	 */
	private String name="defaultName";
	/**
	 * 初始化数据
	 */
	private List<String> initData=new ArrayList<String>(){{
		add("menu");
		add("dict");
		add("user");
	}};
	/**
	 * 是否启用多租户
	 */
	private boolean enableTenant=false;
	/**
	 * 版本
	 */
	private String version ="1.0.0";
	/**
	 * 生成token时候是否将realIp加入到token中一起计算,true:不同客户端使用相同用户登录,返回的token不同;false:不同客户端使用相同用户登录,返回的token相同
	 */
	private boolean addRealIpToToken=true;
	/**
	 * 是否使用数据库时间,默认false
	 */
	private boolean useDatabaseTime=false;
	/**
	 * 默认超级管理员Account的id
	 */
	private List<String> defaultSuperAdministratorAccountIds=new ArrayList<String>(){{
		add("system");
	}};
	/**
	 * 是否实时加载消息码
	 * true: 数据库添加消息码后立即生效(一般用于开发环境)
	 * false: 数据库添加消息码后重启生效(一般用于生产环境)
	 */
	private boolean realTimeLoadingMessageCode=false;
	/**
	 * 配置中心
	 */
	private String openConfigServer;
	/**
	 * 注册中心
	 */
	private String openEurekaServer;
	/**
	 * 路由网关
	 */
	private String openGatewayServer;
	/**
	 * 认证中心
	 */
	private String openOauthServer;
	/**
	 * 系统服务
	 */
	private String openSystemServer;
	/**
	 * 文档服务
	 */
	private String openDocumentServer;
	/**
	 * 日志服务
	 */
	private String openLogServer;
	/**
	 * 消息服务
	 */
	private String openMessageServer;
	/**
	 * 后台任务服务
	 */
	private String openTaskServer;
	/**
	 * 工作流bpm服务
	 */
	private String openWorkflowServer;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<String> getInitData() {
		return initData;
	}

	public void setInitData(List<String> initData) {
		this.initData = initData;
	}

	public boolean isEnableTenant() {
		return enableTenant;
	}

	public void setEnableTenant(boolean enableTenant) {
		this.enableTenant = enableTenant;
	}

	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	public boolean isAddRealIpToToken() {
		return addRealIpToToken;
	}

	public void setAddRealIpToToken(boolean addRealIpToToken) {
		this.addRealIpToToken = addRealIpToToken;
	}

	public boolean isUseDatabaseTime() {
		return useDatabaseTime;
	}

	public void setUseDatabaseTime(boolean useDatabaseTime) {
		this.useDatabaseTime = useDatabaseTime;
	}

	public List<String> getDefaultSuperAdministratorAccountIds() {
		return defaultSuperAdministratorAccountIds;
	}

	public void setDefaultSuperAdministratorAccountIds(List<String> defaultSuperAdministratorAccountIds) {
		this.defaultSuperAdministratorAccountIds = defaultSuperAdministratorAccountIds;
	}

	public boolean isRealTimeLoadingMessageCode() {
		return realTimeLoadingMessageCode;
	}

	public void setRealTimeLoadingMessageCode(boolean realTimeLoadingMessageCode) {
		this.realTimeLoadingMessageCode = realTimeLoadingMessageCode;
	}

	public String getOpenConfigServer() {
		return openConfigServer;
	}

	public void setOpenConfigServer(String openConfigServer) {
		this.openConfigServer = openConfigServer;
	}

	public String getOpenEurekaServer() {
		return openEurekaServer;
	}

	public void setOpenEurekaServer(String openEurekaServer) {
		this.openEurekaServer = openEurekaServer;
	}

	public String getOpenGatewayServer() {
		return openGatewayServer;
	}

	public void setOpenGatewayServer(String openGatewayServer) {
		this.openGatewayServer = openGatewayServer;
	}

	public String getOpenOauthServer() {
		return openOauthServer;
	}

	public void setOpenOauthServer(String openOauthServer) {
		this.openOauthServer = openOauthServer;
	}

	public String getOpenSystemServer() {
		return openSystemServer;
	}

	public void setOpenSystemServer(String openSystemServer) {
		this.openSystemServer = openSystemServer;
	}

	public String getOpenDocumentServer() {
		return openDocumentServer;
	}

	public void setOpenDocumentServer(String openDocumentServer) {
		this.openDocumentServer = openDocumentServer;
	}

	public String getOpenMessageServer() {
		return openMessageServer;
	}

	public void setOpenMessageServer(String openMessageServer) {
		this.openMessageServer = openMessageServer;
	}

	public String getOpenTaskServer() {
		return openTaskServer;
	}

	public void setOpenTaskServer(String openTaskServer) {
		this.openTaskServer = openTaskServer;
	}

	public String getOpenWorkflowServer() {
		return openWorkflowServer;
	}

	public void setOpenWorkflowServer(String openWorkflowServer) {

		this.openWorkflowServer = openWorkflowServer;
	}

	public String getOpenLogServer() {
		return openLogServer;
	}

	public void setOpenLogServer(String openLogServer) {
		this.openLogServer = openLogServer;
	}
}
